package com.expressage.service.impl;
import com.expressage.dao.PackageDao;
import com.expressage.po.Package;
import com.expressage.service.PackageService;
import com.expressage.vo.PackInfo;
import com.expressage.vo.PackageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 快递业务逻辑实现
 */


@Service
public class PackageServiceImpl implements PackageService {

    @Autowired
    PackageDao packageDao;

    @Override
    public List<PackageVO> findAll() {
        return packageDao.findAll();
    }

    @Override
    public PackageVO findByOdd(String odd) {
        return packageDao.findByOdd(odd);
    }

    @Override
    public List<Package> find(Package pack) {
        return packageDao.find(pack);
    }

    @Override
    public boolean addPackage(Package pack) {
        return packageDao.addPackage(pack)>0?true:false;
    }

    @Override
    public boolean updatePackage(Package pack) {
        return packageDao.updatePackage(pack)>0?true:false;
    }

    @Override
    public boolean deletePackage(int[] arrays) {
        return packageDao.deletePackage(arrays)>0?true:false;
    }

    @Override
    public PackInfo findByStaffid(int staffid) {
        return packageDao.findByStaffid(staffid);
    }

    @Override
    public List<PackageVO> findByUid(int uid) {
        return packageDao.findByUid(uid);
    }
}
